home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
This Disc Bytes!
/
Power Computing - The Disc 2 - This Disc Bytes.ISO
/
pc
/
codewarr
/
macossup
/
headers
/
ansihead
/
stdio.h
< prev
next >
Wrap
Text File
|
1995-08-02
|
4KB
|
136 lines
/* stdio.h standard header */
#ifndef _STDIO
#define _STDIO
#ifndef _YVALS
#include <yvals.h>
#endif
#if __MWERKS__
#pragma options align=mac68k
#pragma direct_destruction off
#endif
/* macros */
#ifndef NULL
#define NULL _NULL
#endif
#define _IOFBF 0
#define _IOLBF 1
#define _IONBF 2
#if !__MWERKS__
#define BUFSIZ 512
#else
#define BUFSIZ 4096
#endif
#define EOF (-1)
#define FILENAME_MAX _FNAMAX
#define FOPEN_MAX _FOPMAX
#define L_tmpnam _TNAMAX
#define TMP_MAX 32
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#define stdin (&_Stdin)
#define stdout (&_Stdout)
#define stderr (&_Stderr)
/* type definitions */
#ifndef _SIZET
#define _SIZET
typedef _Sizet size_t;
#endif
typedef _Fpost fpos_t;
typedef struct _Filet {
unsigned short _Mode;
short _Handle;
unsigned char *_Buf, *_Bend, *_Next;
unsigned char *_Rend, *_Wend, *_Rback;
_Wchart *_WRback, _WBack[2];
unsigned char *_Rsave, *_WRend, *_WWend;
struct _Mbstatet _Wstate;
char *_Tmpnam;
unsigned char _Back[2], _Cbuf;
} FILE;
/* declarations */
_C_LIB_DECL
extern FILE _Stdin, _Stdout, _Stderr;
void clearerr(FILE *); int fclose(FILE *); int feof(FILE *);
int ferror(FILE *); int fflush(FILE *); int fgetc(FILE *);
int fgetpos(FILE *, fpos_t *);
char *fgets(char *, int, FILE *);
FILE *fopen(const char *, const char *);
int fprintf(FILE *, const char *, ...);
int fputc(int, FILE *); int fputs(const char *, FILE *);
size_t fread(void *, size_t, size_t, FILE *);
FILE *freopen(const char *, const char *, FILE *);
int fscanf(FILE *, const char *, ...);
int fseek(FILE *, long, int);
int fsetpos(FILE *, const fpos_t *); long ftell(FILE *);
size_t fwrite(const void *, size_t, size_t, FILE *);
char *gets(char *);
void perror(const char *); int printf(const char *, ...);
int puts(const char *); int remove(const char *);
int rename(const char *, const char *);
void rewind(FILE *); int scanf(const char *, ...);
void setbuf(FILE *, char *);
int setvbuf(FILE *, char *, int, size_t);
int sprintf(char *, const char *, ...);
int sscanf(const char *, const char *, ...);
FILE *tmpfile(void); char *tmpnam(char *);
int ungetc(int, FILE *);
int vfprintf(FILE *, const char *, _Va_list);
int vprintf(const char *, _Va_list);
int vsprintf(char *, const char *, _Va_list);
long _Fgpos(FILE *, fpos_t *);
int _Flocale(FILE *, const char *, int);
void _Fsetlocale(FILE *, int);
int _Fspos(FILE *, const fpos_t *, long, int);
int putc(int, FILE *); int putchar(int);
extern FILE *_Files[FOPEN_MAX];
_END_C_LIB_DECL
#ifdef __cplusplus
/* inlines, for C++ */
inline int getc(FILE *_Str) {return ((_Str->_Next
< _Str->_Rend ? *_Str->_Next++ : fgetc(_Str))); }
inline int getchar() {return ((_Files[0]->_Next
< _Files[0]->_Rend ? *_Files[0]->_Next++ : fgetc(_Files[0]))); }
/*
inline int putc(int _C, FILE *_Str) {return ((_Str->_Next
< _Str->_Wend ? (*_Str->_Next++ = _C) : fputc(_C, _Str))); }
inline int putchar(int _C) {return ((_Files[1]->_Next
< _Files[1]->_Wend ? (*_Files[1]->_Next++ = _C)
: fputc(_C, _Files[1]))); }
*/
#else
/* declarations and macro overrides, for C */
int getc(FILE *); int getchar(void);
#define getc(str) ((str)->_Next < (str)->_Rend \
? *(str)->_Next++ : (fgetc)(str))
#define getchar() (_Files[0]->_Next < _Files[0]->_Rend \
? *_Files[0]->_Next++ : (fgetc)(_Files[0]))
/*
#define putc(c, str) ((str)->_Next < (str)->_Wend \
? (*(str)->_Next++ = c) : (fputc)(c, str))
#define putchar(c) (_Files[1]->_Next < _Files[1]->_Wend \
? (*_Files[1]->_Next++ = c) : (fputc)(c, _Files[1]))
*/
#endif /* __cplusplus */
#if __MWERKS__
#pragma options align=reset
#pragma direct_destruction reset
#endif
#endif /* _STDIO */
/*
* Copyright (c) 1994 by P.J. Plauger. ALL RIGHTS RESERVED.
* Consult your license regarding permissions and restrictions.
*/
/* Change log:
*94June04 PlumHall baseline
*94Sept30 Applied diffs for Thu Aug 25 23:13:15 1994
*94Oct07 Inserted MW changes.
*94Oct12mm Set MWs BUFSIZ to 4096
*/